<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>页面导航 - EnterpriseAI</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
            background: #f8f9fa;
            margin: 0;
            padding: 0;
            height: 100vh;
            width: 100vw;
        }
        .layout {
            display: flex;
            height: 100vh;
        }
        .sidebar {
            width: 260px;
            background: #fff;
            border-right: 1.5px solid #e0e0e0;
            box-shadow: 2px 0 8px rgba(0,0,0,0.04);
            padding: 0 0 24px 0;
            display: flex;
            flex-direction: column;
        }
        .sidebar h1 {
            text-align: center;
            color: #1976d2;
            font-size: 1.6em;
            margin: 32px 0 18px 0;
            letter-spacing: 1px;
        }
        .sidebar h2 {
            color: #388e3c;
            margin: 18px 0 8px 32px;
            font-size: 1.1em;
        }
        .sidebar ul {
            list-style: none;
            padding-left: 32px;
            margin: 0 0 0 0;
        }
        .sidebar li {
            margin-bottom: 8px;
        }
        .sidebar a {
            color: #1976d2;
            text-decoration: none;
            font-size: 1.03em;
            transition: color 0.2s;
            display: block;
            padding: 2px 0;
        }
        .sidebar a.active {
            color: #f57c00;
            font-weight: bold;
        }
        .sidebar a:hover {
            color: #f57c00;
            text-decoration: underline;
        }
        .workspace {
            flex: 1;
            background: #f8f9fa;
            padding: 0;
            display: flex;
            flex-direction: column;
            min-width: 0;
        }
        .workspace-iframe {
            border: none;
            width: 100%;
            height: 100%;
            flex: 1;
            background: #fff;
        }
        .workspace-placeholder {
            color: #bdbdbd;
            text-align: center;
            margin-top: 120px;
            font-size: 1.3em;
        }
    </style>
</head>
<body>
<div class="layout">
    <nav class="sidebar">
        <h1>INTDOS 页面导航</h1>
        <h2>代码助手和问答/</h2>
        <ul>
            <li><a href="#cm/t01_techArch.html" data-src="./cm/t01_techArch.html">t01_techArch.html</a></li>
            <li><a href="#cm/t02_promissionManage.html" data-src="./cm/t02_promissionManage.html">t02_promissionManage.html</a></li>
            <li><a href="#cm/t03_roleControl.html" data-src="./cm/t03_roleControl.html">t03_roleControl.html</a></li>
            <li><a href="#cm/t04_search.html" data-src="./cm/t04_search.html">t04_search.html</a></li>
            <li><a href="#cm/t05_codeMate.html" data-src="./cm/t05_codeMate.html">t05_codeMate.html</a></li>
            <li><a href="#cm/t06_askMe.html" data-src="./cm/t06_askMe.html">t06_askMe.html</a></li>
        </ul>
        <h2>文档助手/</h2>
        <ul>
            <li><a href="#doc/1_system_management.html" data-src="./doc/1_system_management.html">1_system_management.html</a></li>
            <li><a href="#doc/2_data_acquisition.html" data-src="./doc/2_data_acquisition.html">2_data_acquisition.html</a></li>
            <li><a href="#doc/3_template_management.html" data-src="./doc/3_template_management.html">3_template_management.html</a></li>
            <li><a href="#doc/4_content_configuration.html" data-src="./doc/4_content_configuration.html">4_content_configuration.html</a></li>
            <li><a href="#doc/5_flow_analysis.html" data-src="./doc/5_flow_analysis.html">5_flow_analysis.html</a></li>
            <li><a href="#doc/6_document_generation.html" data-src="./doc/6_document_generation.html">6_document_generation.html</a></li>
            <li><a href="#doc/s01_designArch.html" data-src="./doc/s01_designArch.html">s01_designArch.html</a></li>
        </ul>
    </nav>
    <main class="workspace">
        <div class="workspace-placeholder" id="workspace-placeholder">请选择左侧页面进行预览</div>
        <iframe class="workspace-iframe" id="workspace-iframe" style="display:none;"></iframe>
    </main>
</div>
<script>
    const links = document.querySelectorAll('.sidebar a[data-src]');
    const iframe = document.getElementById('workspace-iframe');
    const placeholder = document.getElementById('workspace-placeholder');

    function setActive(link) {
        links.forEach(l => l.classList.remove('active'));
        if (link) link.classList.add('active');
    }

    function openPage(src, link) {
        if (src) {
            iframe.src = src;
            iframe.style.display = '';
            placeholder.style.display = 'none';
            setActive(link);
        }
    }

    links.forEach(link => {
        link.addEventListener('click', function(e) {
            e.preventDefault();
            openPage(this.getAttribute('data-src'), this);
            window.location.hash = this.getAttribute('href');
        });
    });

    // 支持刷新后hash定位
    window.addEventListener('DOMContentLoaded', () => {
        const hash = window.location.hash;
        if (hash) {
            const link = Array.from(links).find(l => l.getAttribute('href') === hash);
            if (link) {
                openPage(link.getAttribute('data-src'), link);
            }
        }
    });
</script>
</body>
</html>
